package com.mdhw.controller;


import com.mdhw.config.R;
import com.mdhw.mili.service.MiliDeviceService;
import com.mdhw.mili.vo.device.OpenDoorReqVo;
import com.mdhw.mili.vo.device.ProjectDeviceInfoOpenReqVo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "设备相关接口")
@RequestMapping("device")
public class DeviceController {

    @Autowired
    private MiliDeviceService miliDeviceService;

    @PostMapping("/openDoor")
    public R openDoor(@RequestBody ProjectDeviceInfoOpenReqVo projectDeviceInfoOpenReqVo) {
        OpenDoorReqVo openDoorReqVo = new OpenDoorReqVo();
        openDoorReqVo.setProjectDeviceInfoOpenVo(projectDeviceInfoOpenReqVo);
        return this.miliDeviceService.openDoor(openDoorReqVo);
    }
}
